﻿Public Class ven_pol6

    Private Sub btnok_ven_pol6_Click(sender As Object, e As EventArgs) Handles btnok_ven_pol6.Click
        yc6 = Convert.ToSingle(txtyc6_jp6.Text)
        fp16 = Convert.ToSingle(txt_fp16.Text)
        fp26 = Convert.ToSingle(txt_fp26.Text)
        dp16 = Convert.ToSingle(txt_dp16.Text)
        dp26 = Convert.ToSingle(txt_dp26.Text)
        tetap6 = Convert.ToSingle(txt_tetap6.Text)
        decp6 = Convert.ToSingle(txt_decp6.Text)

        tetap6 = tetap6 * (3.141592 / 180)
        alfap6 = Math.Asin((dp26 - dp16) / (2 * decp6))

        fxcp6 = -Math.Cos(alfap6) * (fp16 + fp26)
        fzcp6 = Math.Sin(alfap6) * (fp16 - fp26)

        fxp6 = fxcp6 * Math.Cos(tetap6) - fzcp6 * Math.Sin(tetap6)
        fzp6 = fxcp6 * Math.Sin(tetap6) + fzcp6 * Math.Cos(tetap6)

        c6x = fxp6
        c6y = 0
        c6z = fzp6
        m6x = 0
        m6y = -(fp16 + fp26) * dp16 * 0.5
        m6z = 0

        Me.Close()
    End Sub
End Class